import { createApp } from 'vue';
import App from './App';
import { createPinia } from 'pinia';
import piniaPersist from 'pinia-plugin-persist';
import router from './router';
import ViewUiPlus from 'view-ui-plus';
import 'view-ui-plus/dist/styles/viewuiplus.css';
import './styles/index.less';
import './styles/tailwindcss.css';
import VueLazyLoad from 'vue3-lazyload';

// 根据环境变量动态引入字体依赖文件
if (import.meta.env.APP_FLAG == 'dev') {
  import('./assets/fonts/devfont.css');
} else {
  import('./assets/fonts/font.css');
}

// import axios from 'axios';
// pinia - 状态管理+状态持久化
const pinia = createPinia().use(piniaPersist);

const app = createApp(App);
// app.config.globalProperties.$http = axios;

app.use(router).use(pinia).use(VueLazyLoad, {}).use(ViewUiPlus).mount('#app');
